<?php
/**
* @Copyright Copyright (C) 2010- ... Andy Sharman
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
**/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

//magic quotes buggers this up.
ini_set("magic_quotes_gpc", 0);

//CHECKS IF POSTED, SENDS TO METHOD
if (JRequest::getString('txtFileContents'))
{
	$newContents = htmlentities($_POST['txtFileContents'],ENT_QUOTES);
	$CF->updateOutput($newContents);
}

//get content for textarea
$data		= file_get_contents(JPATH_COMPONENT.DS.'cf.output.php');
$content	= htmlentities($data,ENT_QUOTES);
?>

<form name="frmAdvanced" method="post" action="" enctype="multipart/form-data">
<textarea name="txtFileContents" style="width:750px;height:400px;border:1px solid #999999;">
<?php
echo $content;
?>
</textarea>
<p style="display:inline-block; width:750px; text-align:right;">
	<input type="submit" name="btnAdvancedSave" value="save" />
</p>
</form>